//
//  NSObject+Extension.h
//  2016年11月16日21:39:19
//
//  Created by ya on 16/11/22.
//  Copyright © 2016年 ya. All rights reserved.
//

#import <UIKit/UIKit.h>

extern void NotificationCenterPost(NSString *key, id obj, NSDictionary *userInfo);
extern void NotificationCenterAddObserver(id observer, NSString *key, SEL sel);
extern void NotificationRemoveObserver(id self);

extern NSString * DocumentDirectory();
extern NSString * CachesDirectory();
extern NSString * TemporaryDirectory();
extern NSString * BundleName();
extern NSString * NSStringFromInteger(NSInteger integer);
extern UIImage  * Image(NSString *name);


@interface NSObject (Extension)
// MARK: -----------------------<-_cmd使用->-----------------------
/// 运行时添加属性
@property (nonatomic, strong) NSString *name;


/// 返回一个Window
+ (instancetype)windowWithRootViewController:(UIViewController *)viewController;

/// 返回一个控制器响应者
- (UIViewController *)viewControllerResponder;

// MARK: -----------------------<-VFL 约束->-----------------------
NSArray<__kindof NSLayoutConstraint *> *constraints(UIView *target, NSArray<NSString *> *formats, NSDictionary<NSString *, UIView *> *views);

+ (NSArray<NSString *> *)getInvarListName;
+ (NSArray<NSString *> *)getMethodListNames;
+ (NSArray<NSString *> *)getPropertyListNames;
+ (NSArray<NSString *> *)getProtocolListNames;

__kindof UIView *nibView(NSString *nibName);
UINib *nib(NSString *nibName);

- (NSObject *(^)(NSObject *))checkObj;

@end
